package lhc.alg.top100;

/**
 * description:
 * 嘶 变种26进制
 * author: hongchen.liao
 * date:  2022/9/7
 */
public class _171_Excel_Sheet_Column_Number {

    class Solution {
        public int titleToNumber(String columnTitle) {
            int number = 0;
            int multiple = 1;
            for(int i = columnTitle.length()-1; i >= 0; i--){
                int k = columnTitle.charAt(i) - 'A' + 1;
                number += k * multiple;
                multiple *= 26;
            }
            return number;
        }
    }

}
